//1、引入EventEmitter构造函数
const events = require("events");
const EventEmitter = events.EventEmitter;

//2、进行事件对象的实例化
let eventObj = new EventEmitter();

//3、时间的监听
eventObj.on("hello", (args) => {
    console.log(args);
    console.log("node events");
})
//4、事件的触发
eventObj.emit("hello", ["test"]);